﻿<?php 
require("admin/php/connection.php");
$wedding_name =  $_SERVER["QUERY_STRING"];
$_name =  urldecode($wedding_name);
echo "start.....";
echo $_name;
session_start();
echo $_name=="";
if($_name==""){
	$_name="zt";
}
echo $_name;
$_SESSION["realName"]=$_name;

$query = "SELECT * FROM basc_message where user_id=(select id from user where realName='$_name')";
$result = mysql_query($query) or die("Query failed.");
$message =  mysql_fetch_row($result);
$_SESSION["wedding_info"]=$message;
echo $message[6];
$map_query = "SELECT * FROM map where user_id=(select id from user where realName='$_name')";
$map_result = mysql_query($map_query) or die("Query failed.");
$map =  mysql_fetch_row($map_result);
$_SESSION["map"]=$map;

$photo_query = "SELECT * FROM photo WHERE user_id=(select id from user where realName='$_name') and usage_type=2";
$photo_result = mysql_query($photo_query) or die("Query failed.");
$index = 0;
$photoes=null;
while($row =  mysql_fetch_array($photo_result)){
	$photoes[$index]=$row[2];
	$index++;
}
$_SESSION["photoes"]=$photoes;

$home_pic_query = "SELECT * FROM photo WHERE user_id=(select id from user where realName='$_name')  and usage_type=1";
$home_pic_result = mysql_query($home_pic_query) or die("Query failed.");
$home_pic =  mysql_fetch_row($home_pic_result);
$_SESSION["pic"]=$home_pic;

echo $home_pic[3];
header ("Location:html/home.php") ;
?>